<div class="layui-header">

    <ul class="layui-nav layui-layout-left">

    <li class="layui-nav-item layadmin-flexible" lay-unselect>
    <a href="javascript:;" layadmin-event="flexible" title="侧边伸缩">
        <i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
    </a>
    </li>

        <li class="layui-nav-item" lay-unselect>
        <a href="javascript:;" layadmin-event="refresh" title="刷新">
        <i class="layui-icon layui-icon-refresh-3"></i>
        </a> 
        </li>


        <li class="layui-nav-item" lay-unselect>
        <a href="http://dragonli.bobzuo.com" target="help_window" title="帮助">
        <i class="layui-icon layui-icon-help"></i>
        </a>
        </li> 
  
        <li class="layui-nav-item" lay-unselect>
        <dd><a href="" id="dateTime"></a></dd>
        </li>
    </ul>



    <!-- 头部区域 -->
    <% const barType=ret.barType||'normal';%>
    <% if(barType==='right'){ %>
    <div style="background-color:#393D49;clear:both;text-align:center;width:100%;height:62px">
    </div>
    <ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">
    <% }else{%>
    <ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">
    <% }%>
        <li class="layui-nav-item" lay-unselect="">
            <%if(ret.level>=100){%>
             <a href="javascript:;"><cite><%=ret.name%>(扫地僧)</cite></a>
            <%}else{%>
            <a href="javascript:;"><cite><%=ret.name%></cite></a>
            <%}%>
       
            <dl class="layui-nav-child">
                <% if(ret.level>=100){%>
<!--                 <hr><a href="/main/?branch=">项目管理</a><hr> -->
                <%}else{%>
                <dd><a href="/main/selectNew">工作台</a></dd>
                <%}%>
                <dd><a href="/changePass/">修改密码</a></dd>
                <hr><a href="/logout/">退出登录</a></hr>
            </dl>
        </li>
         <li class="layui-nav-item layui-hide-xs" lay-unselect>
            <a href="javascript:;" layadmin-event="theme">
                <i class="layui-icon layui-icon-theme"></i>
            </a> 
        </li>
    </ul>
</div> 

<script type="text/javascript">
    Date.prototype.format = function (fmt) {
        var o = {
            "y+": this.getFullYear, //年
            "M+": this.getMonth() + 1, //月份
            "d+": this.getDate(), //日
            "h+": this.getHours(), //小时
            "m+": this.getMinutes(), //分
            "s+": this.getSeconds() //秒
        };
        if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
        for (var k in o)
            if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
        return fmt;
    }
    let _ret1=<%-JSON.stringify(ret)%>;
    function getServerTime(){
        let d = new Date();
        let localTime = d.getTime();
        let localOffset = d.getTimezoneOffset() * 60000;
        let utc = localTime + localOffset; //得到国际标准时间
        let offset =8;

        <% if(ret.setting){%>
            offset= _ret1.setting.zone;
            let calctime = utc + (3600000*offset);
            let nd = new Date(calctime);
            // console.log('指定时区时间是：' + nd);
            document.getElementById('dateTime').innerHTML = `服务器时间(时区:${offset}):  <b>${nd.format('yyyy-MM-dd hh:mm:ss')}</b> `        
        <%}else{%>
            document.getElementById('dateTime').innerHTML=``;
        <%}%>


    }




    setInterval(getServerTime, 1000);
</script>>






